package com.juzi.wopu.query;

import org.apache.commons.lang3.StringUtils;

public class DepartmentQuery extends BaseQuery{
	
	private String username;
	
	private String email;
	
	private Long deptId;
	  
	public DepartmentQuery() {
		super("Employee");
	}
	  
	@Override
	protected void addWhere() {
		if(StringUtils.isNotBlank(username)){
			AddWhere("o.username like ?","%"+username+"%");
		}
		  
		if(StringUtils.isNotBlank(email)){
			AddWhere("o.email like ?","%"+email+"%");
		}
		  
		if(deptId !=null && deptId != -1L){
			AddWhere("o.department.id=?", deptId);
		}
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Long getDeptId() {
		return deptId;
	}
	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}
}
